<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        img {
            width: 500px;
            height: auto;
        }

        body {
            background: no-repeat top center/cover;
        }
    </style>
</head>

<body>
    <img src="" alt="">
    <div class="box">
        class
    </div>
    <script>
        const img = document.querySelector('img')
        // const imgs = [
        //     '../../images/course01.png',
        //     '../../images/凉.png',
        //     '../../images/course02.png',
        //     '../../images/course03.png']
        // const num = Math.floor(Math.random() * imgs.length)
        // img.src = imgs[num]
        // document.body.style.backgroundImage = `url(${imgs[num]})`
        const box = document.querySelector('.box')
        //1.追加类
        // box.classList.add('red')
        //2.移除类
        box.classList.remove('box')
        //3.切换类
        // box.classList.toggle('red')

    </script>
</body>

</html>